using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using MM.Entities;

namespace MM.Business
{
    class clsLOAI_THUOC_TINH
    {
        public clsLOAI_THUOC_TINH(string sConn)
	    {
		    SqlHelper.ConnectionString = sConn;
	    }
        public int InsertUpdateLOAI_THUOC_TINH(string maLoai, string tenLoai)
        {
            int result = 0;
            try
            {
                SqlHelper.OpenConnection();
                string spName = "usp_InsertUpdateLOAI_THUOC_TINH";
                SqlParameter[] par = new SqlParameter[2];
                par[0] = new SqlParameter("@MaLoai", maLoai);
                par[1] = new SqlParameter("@TenLoai", tenLoai);

                result = SqlHelper.ExecuteNonQuery(spName, par);
            }
            catch (Exception ex)
            {
            }
            finally
            {
                if (!SqlHelper.IsHaveTran())
                    SqlHelper.CloseConnection();
            }
            return result;
        }
    }
}
